<?php
if(isset($_SESSION['roles']) && isset($_SESSION['sess_login_username'])){
    if( ($_SESSION['sess_login_username']!='') && ($_SESSION['roles']!='')){

    }
    else
        header('Location: index.php');

}
else
        header('Location: index.php');
require('./roots.php');

require_once('./classes/rbac.php');

include('languaje/'.$_SESSION['lang'].'/lang_'.$_SESSION['lang'].'_rbac.php');

include "header.php";

$action='FuncionCrearRecurso.php';

$msj = '';


if (isset($_GET['result'])){
    $message=$_GET['result'];
    if($message==NULL)
	$Message=$LDCrearRecurError;
    if($message==FALSE)
	$Message=$LDNoPermiso;
    if($message==TRUE)
	$Message=$LDCrearRecur;
}
	
if (isset($_GET['tabla'])){
    $tabla=$_GET['tabla'];

	if($tabla==0)
	 	$Message1=$LDNoTabla;

}

$rbac= new rbac();

$resource=$rbac->Buscar_recurso(NULL,$_SESSION['sess_login_username']);
?>


 <form method="post" action="<?php echo $action; ?>" name="regform" ENCTYPE="multipart/form-data" onSubmit="return chkform(this)"> 


	<div id="page">
	<div id="page-bgtop">
	<div id="page-bgbtm">
		<div id="content">
			<div class="post">
			<div class="post-bgtop">
			<div class="post-bgbtm">
				<h2 class="title"><a href="#"><?php echo $LDCrearRecurso; ?></a></h2>
				
				<div class="entry">
					<p>
                                        <?php echo $Message; ?>
					<?php echo $Message1; ?>
					<div class="table">
                                                <table width=100%>
							<tr>
								<td >
									<?php echo $LDNombre; ?>:
								</td>
								<td >
									<input type="text" name="name" value=""/>
								</td>
							</tr>
                                                        <tr>
								<td >
									<?php echo $LDTipo; ?>:
								</td>
								<td >
									<select name="type">
										<option value=Tabla><?php echo $LDTabla; ?></option>
										<option value=Carpeta><?php echo $LDCarpeta; ?></option>
                                                                                <option value=Funcion><?php echo $LDFuncion; ?></option>
                                                                       	</select>
								</td>
							</tr>
                                                        <tr>
								<td >
									<?php echo $LDUbicacion; ?>:
								</td>
								<td >
									<input type="text" name="location" value=""/>
								</td>
							</tr>
						</table>
                                   	</div>
						<div id="botones">
							<h1><a onclick="document.forms[0].submit()"><?php echo $LDCrear; ?></a></h1>
						</div>
					</p>
				</div>
                                
			</div>
			</div>
			</div>
			
		<div style="clear: both;">&nbsp;</div>
		</div>

		<div id="sidebar">
				<ul>
					<li>
						<h2><?php echo $LDCategorias; ?></h2>
						<?php

						include "MenuRbac.php";

						?>
						<script type="text/javascript">

						cssdropdown.startchrome("chromemenu")

						</script>
				</li>
			</ul>
		</div>

		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	</div>
</div>

</form>
<?php

include "footer.php";

?>
